#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Length.h>
#include <Volume.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(LengthUnit)
{     
   TEST(1 yard should be equal to 3 feet)
   {
      ASSERT_TRUE(Length(3, FEET) == Length(36, INCH));
   }

   TEST(1 feet should be equal to 12 inch)
    {
      ASSERT_TRUE(Length(1, FEET) == Length(12, INCH));
    }

   TEST(1 mile should be equal to 1760 yard)
    {
      ASSERT_TRUE(Length(1, MILE) == Length(1760, YARD));
    }

   TEST(1760 yard should be equal to 1 mile)
    {
      ASSERT_TRUE(Length(1, MILE) == Length(1760, YARD));
    }

   TEST(2 feet should be equal to 11+13 inch)
    {
      ASSERT_TRUE(Length(2, FEET) == (Length(13, INCH) + Length(11, INCH)));
    }

   TEST(3 yard should be equal to 3 feet + 2 yard)
    {
      ASSERT_TRUE(Length(3, YARD) == (Length(2, YARD) + Length(3, FEET)));
    }

   TEST(print 35 INCH should be 2 FEET 11 INCH)
    {
      std::stringstream os;
      os << Length(35, INCH, MILE);

      ASSERT_TRUE(std::string("2 FEET 11 INCH") == os.str());
    }

   TEST(print 38 INCH should be 1 YARD 2 INCH)
    {
      std::stringstream os;
      os << Length(38, INCH, MILE);  

      ASSERT_TRUE(std::string("1 YARD 2 INCH") == os.str());
   }

   TEST(print 48 INCH should be 1 YARD 1 FEET)
    {
      std::stringstream os;
      os << Length(48, INCH, MILE);     

      ASSERT_TRUE(std::string("1 YARD 1 FEET") == os.str());
    }    

   TEST(print 5 FEET should be 1 YARD 2 FEET)
    {
      std::stringstream os;

      os << Length(5, FEET, MILE);   
  
      ASSERT_TRUE(std::string("1 YARD 2 FEET") == os.str());
    }   

    TEST(print 1781 YARD should be 1 MILE 21 YARD)
    {
      std::stringstream os;
      os << Length (1781, YARD, MILE);
     
      ASSERT_TRUE(std::string("1 MILE 21 YARD") == os.str());
    }  

   TEST(print 5 FEET should be 60 INCH)
    {
      std::stringstream os;

      os << Length(5, FEET, INCH);   
  
      ASSERT_TRUE(std::string("60 INCH") == os.str());
    } 

    TEST(print 1781 YARD should be 64116 INCH)
    {
      std::stringstream os;
      os << Length (1781, YARD, INCH);
     
      ASSERT_TRUE(std::string("64116 INCH") == os.str());
    }  

};

